<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

<head>
    <meta charset="UTF-8">
    <title th:text="${page_title}"></title>
    <link rel="stylesheet" href="assets/lib/layui-v2.4.5/css/layui.css"/>
    <link rel="stylesheet" href="assets/css/sadmin.css"/>
    <link rel="stylesheet" href="assets/css/theme-custom.css"/> <!-- 使用EasyWeb主题生成器生成的主题 -->
    <link rel="stylesheet" href="assets/css/errorpage.css"/>
    <link rel="stylesheet" href="assets/css/checkbox.css"/>
    <link rel="stylesheet" href="assets/css/custom.css"/>
</head>

<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!-- 头部 -->
    <div class="layui-header">
        <div class="layui-logo">
            <img src="assets/img/global/logo.png"/>
            <cite th:text="${page_title}"></cite>
        </div>
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item" lay-unselect style="float: left;">
                <a ew-event="flexible" title="侧边伸缩"><i class="layui-icon layui-icon-shrink-right"></i></a>
            </li>
            <li style="float: left;line-height: 50px;display: inline-block;">
                <span class="layui-breadcrumb">
				  <a href="/" class="frame-head" style="padding: 0 5px;" id="desktop">控制台</a>
				</span>
            </li>
        </ul>
        
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item" lay-unselect>
                <a id="btnMessage" title="消息"><i class="layui-icon layui-icon-notice"></i></a>
            </li>
            <li class="layui-nav-item layui-hide-xs" lay-unselect>
                <a ew-event="fullScreen" title="全屏"><i class="layui-icon layui-icon-screen-full"></i></a>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a>
                    <img src="assets/img/global/head.png" class="layui-nav-img">
                    <cite><shiro:principal property="userName"/></shiro:principal></cite>
                </a>
                <dl class="layui-nav-child">
                    <dd lay-unselect>
                        <a id="btnPersonal">个人信息</a>
                    </dd>
                    <dd lay-unselect>
                        <a id="btnPasswd">修改密码</a>
                    </dd>
                    <hr>
                    <dd lay-unselect>
                        <a id="btnLogout">退出</a>
                    </dd>
                </dl>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a ew-event="theme" title="主题"><i class="layui-icon layui-icon-more-vertical"></i></a>
            </li>
        </ul>
    </div>

    <!-- 侧边栏 -->
    <div class="layui-side">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree layui-inline" lay-shrink="all" style="margin-top: 15px;">
                <li class="layui-nav-item layui-nav-itemed">
                    <a href="javascript:;"><i class="layui-icon layui-icon-home"></i>&emsp;<cite>主页</cite></a>
                    <dl class="layui-nav-child">
                        <dd class="layui-this">
                            <a lay-href="home/console.html">控制台</a>
                        </dd>
                    </dl>
                </li>
                
                <li class="layui-nav-item" th:each="menu : ${menus}">
                	<a lay-href="javascript:;"><i class="layui-icon layui-icon-app"></i>&emsp;<cite th:text="${menu.displayName}"></cite></a>
                	<dl class="layui-nav-child">
                        <dd th:each="cmenu : ${menu.children}">
                            <a th:if="${#lists.isEmpty(cmenu.children)}" th:attr="lay-href=@{${cmenu.directUrl}}" th:text="${cmenu.displayName}"></a>
                            <a th:if="${not #lists.isEmpty(cmenu.children)}" lay-href="javascript:;" th:text="${cmenu.displayName}"></a>
                            <dl th:if="${not #lists.isEmpty(cmenu.children)}" class="layui-nav-child">
                                <dd th:each="emenu : ${cmenu.children}">
                                	<a class="menuItem" th:text="${emenu.displayName}" th:attr="lay-href=@{${emenu.directUrl}}"></a>
                                </dd>
                            </dl>
                        </dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <!-- 主体部分 -->
    <div class="layui-body" style="overflow-y: auto;bottom: 0;">
    </div>

    <!-- 手机屏幕遮罩层 -->
    <div class="site-mobile-shade"></div>

</div>

<!-- 加载动画，移除位置在common.js中 -->
<!--<div class="page-loading">
    <div class="rubik-loader"></div>
</div>-->


<script type="text/javascript" src="assets/lib/layui-v2.4.5/layui.js"></script>
<script type="text/javascript" src="assets/js/common.js"></script>
<script>
    layui.config({
        base: '/module/'
    }).extend({
        // formSelects: 'formSelects/formSelects-v4',
        // treetable: 'treetable-lay/treetable'
    }).use(['jquery', 'sadmin'], function () {
		var $ = layui.$ //重点处
        var sadmin = layui.sadmin;

		// 导航栏联动
        sadmin.initRouter();

		// 主页
        sadmin.loadView({
			menuId: 'home_console',
			menuPath: 'home/console.html',
			menuName: 'home_console'
		});

		// 消息点击事件
		$('#btnMessage').click(function () {
            sadmin.popupRight('home/message.html');
		});
        // 修改个人信息
        $('#btnPersonal').click(function () {
            sadmin.popupRight('home/personal.html');
        });
        // 修改密码
        $('#btnPasswd').click(function () {
            sadmin.popupRight('home/password.html');
        });
        // 退出登录
        $('#btnLogout').click(function () {
            layer.confirm('确定退出登录？', function () {
                location.replace('logout');
            });
        });
    });

</script>

</body>
</html>